﻿
@{
    Layout = null;
}

<!doctype html>
<html class="no-js" lang="en">
<head>
    <meta charset="utf-8">
    <title>@ViewBag.Setting.MallName</title>
    <meta name="description" content="@ViewBag.Setting.Description">
    <meta name="author" content="">
    <meta name="keywords" content="@ViewBag.Setting.Keywords">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!-- Mobile Specific Meta  -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- Google Fonts -->
    <link href='https://fonts.googleapis.com/css?family=Lato:400,300,700,900,100' rel='stylesheet' type='text/css'>

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="~/Content/desktop/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/Content/desktop/css/font-awesome.min.css" />
    <!-- Custom CSS -->
    <link href="~/Content/desktop/style.css" rel="stylesheet">

    @*<link rel="icon" type="image/png" href="~/Content/libs/assets/i/favicon.png">*@



    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="http://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <!--[if lt IE 8]>
        <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->
    <!-- header-start -->
    <header>
        <div class="header-top">
            <div class="container">
                <div class="row">
                    <div class="col-md-6 col-xs-12 col-sm-12">
                        <div class="header-top-left">
                            <div class="welcome-msg">
                                <span class="default-msg hidden-xs">
                                    Cai xiao huan!
                                </span>
                                <span class="phone">
                                    Call support free: <span class="number">158-0205-7361</span>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6 col-xs-12 col-sm-12">
                        <div class="header-top-right">
                            <ul class="header-links hidden-xs">

                                <li>
                                    <a class="my-wishlist" href="#">
                                        My Wishlist
                                    </a>
                                </li>
                            </ul>
                            <div class="currency language">
                                <div class="current">
                                    <span>Dollar</span>
                                </div>
                                <ul class="lang">
                                    <li>
                                        <a href="#" title="">
                                            <span class="euro">Euro</span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="header-middle">
            <div class="container">
                <div class="row">
                    <div class="col-md-4 col-sm-12 col-xs-8">
                     
                    </div>
                    <div class="col-md-5 col-sm-6 col-xs-12">
                        <div class="search-box">
                            <form action="/Home/Index">
                                <input class="form-control search-form" name="goodsName" type="text" value="@(ViewBag.goodsName)" placeholder="请输入商品名称">
                                <button class="search-button" value="Search" type="submit">
                                    <i class="fa fa-search"></i>
                                </button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
           
        </div>
    </header>
    <!-- header-end -->
    <!-- shop-area-start -->
    <div class="shop-area">
        <div class="container">
            <div class="row">
                <div class="widget-body am-fr">
                    <div class="col-md-3 col-sm-3 hidden-xs">
                        <div class="shop-left-col wow fadeIn" data-wow-duration=".5s" data-wow-delay=".5s">
                            <div class="content-box">
                                <h2>商品类目</h2>
                                <ul class="tags">
                                    @if (ViewBag.ACommodityRsp.IsSuccess)
                                    {
                                        if (ViewBag.ACommodityRsp.Models.Count > 0)
                                        {
                                            foreach (var item in ViewBag.ACommodityRsp.Models as List<Knight.Models.Entity.ClassACommodity>)
                                            {
                                                if (ViewBag.classACommodity == item.Name)
                                                {
                                                    <li class="active">
                                                        <a href="/Home/Index?classACommodity=@(item.Name)">@(item.Name) (@item.DisplayIndex)</a>
                                                    </li>
                                                }
                                                else
                                                {
                                                    <li>
                                                        <a href="/Home/Index?classACommodity=@(item.Name)">@(item.Name) (@item.DisplayIndex)</a>
                                                    </li>
                                                }
                                            }
                                        }
                                    }
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-9 col-sm-9 col-xs-12">
                        <div class="shop-right-col wow fadeIn" data-wow-duration=".5s" data-wow-delay=".5s">
                            <div class="category-products">
                                <div class="shop-category-product">
                                    <div class="row">
                                        <div class="category-product">
                                            <!-- Tab panes -->
                                            <div class="tab-content">
                                                <div role="tabpanel" class="tab-pane active fade in" id="list_view">
                                                    <div class="list-view">
                                                        <div class="row" id="carousel-img">
                                                            @if (ViewBag.Result.IsSuccess)
                                                            {
                                                                if (ViewBag.Result.Models.Count > 0)
                                                                {
                                                                    foreach (var item in ViewBag.Result.Models as List<Knight.Models.Entity.CouponInfo>)
                                                                    {
                                                                        <div class="col-md-6 col-sm-6 col-xs-12 top-mar">
                                                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                                                <!-- single-product-start -->
                                                                                <div class="single-product">
                                                                                    <div class="single-product-img">
                                                                                        <a target="_blank" href="@item.TaobaoLinks">
                                                                                            <img width="262" height="262" title="@item.GoodsName" src="@item.CommodityMasterDiagram" alt="@item.GoodsName" />
                                                                                        </a>
                                                                                        <span class="sale-box">
                                                                                            <span class="sale">-@(item.CouponAmount)</span>
                                                                                        </span>
                                                                                    </div>
                                                                                </div>
                                                                                <!-- single-product-end -->
                                                                            </div>
                                                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                                                <!-- single-product-start -->
                                                                                <div class="single-product">
                                                                                    <div class="single-product-content">
                                                                                        <div class="product-title">
                                                                                            <h5>
                                                                                                @if (@item.GoodsName.Length > 30)
                                                                                                {
                                                                                                    <a target="_blank" href="@item.TaobaoLinks">@(item.GoodsName.Substring(0, 29)).....</a>
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                    <a target="_blank" href="@item.TaobaoLinks">@item.GoodsName</a>
                                                                                                }
                                                                                            </h5>
                                                                                        </div>
                                                                                        <div class="rating">
                                                                                            <div class="star star-on"></div>
                                                                                            <div class="star star-on"></div>
                                                                                            <div class="star star-on"></div>
                                                                                            <div class="star star-on"></div>
                                                                                            <div class="star star-on"></div>
                                                                                        </div>
                                                                                        <div class="price-box">
                                                                                            <span class="price">￥@(item.CommodityPrice - item.CouponAmount)</span>
                                                                                            <span class="old-price">￥@(item.CommodityPrice)</span>
                                                                                        </div>
                                                                                        <div class="product-action">
                                                                                            <button onclick="window.open('@item.MerchandiseCouponPromotionLink');" class="button btn btn-success add-cart" title="@item.GoodsName">领券购买</button>
                                                                                        </div>
                                                                                        <p class="product-desc">
                                                                                            有效期至 @item.CouponEndTime.ToString("yyyy-MM-dd")
                                                                                        </p>
                                                                                    </div>
                                                                                </div>
                                                                                <!-- single-product-end -->
                                                                            </div>
                                                                        </div>
                                                                    }
                                                                }
                                                            }
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <hr />
                                    <div class="row">
                                        @if (ViewBag.Result.TotalPages > 1)
                                        {
                                            @Html.Raw(ViewBag.PageHtml)
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- shop-area-end -->
    <!-- footer-start -->
    <footer>
        <div class="footer-area wow fadeIn" data-wow-duration=".5s" data-wow-delay=".5s">
            @Html.Raw(ViewBag.Setting.FootContent)
        </div>
    </footer>
    <!-- footer-end -->
    <!-- all js here -->
    <!-- jquery latest version -->
    <script src="~/Content/desktop/js/vendor/jquery-1.12.0.min.js"></script>
    <!-- bootstrap js -->
    <script src="~/Content/desktop/js/bootstrap.min.js"></script>
    <!-- owl.carousel js -->
    <script src="~/Content/desktop/js/owl.carousel.min.js"></script>
    <!-- meanmenu js -->
    <script src="~/Content/desktop/js/jquery.meanmenu.js"></script>
    <!-- countdown js -->
    <script src="~/Content/desktop/js/countdown.js"></script>
    <!-- jquery.nivo.slider.pack js -->
    <script src="~/Content/desktop/js/jquery.nivo.slider.pack.js"></script>
    <!-- jquery-ui.min.js -->
    <script src="~/Content/desktop/js/jquery-ui.min.js"></script>
    <!-- wow js -->
    <script src="~/Content/desktop/js/wow.min.js"></script>
    <!-- plugins js -->
    <script src="~/Content/desktop/js/plugins.js"></script>  
    <!-- main js -->
    <script src="~/Content/desktop/js/main.js"></script>

    <script type="text/javascript">
        $(function () {
            var slideArr = $('#carousel-img>div');
            // 将轮播图的图片设置为相同的高度
            equalArrHeight(slideArr, 'large');
            // location.href = "#list_view";
        })
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
        function equalArrHeight(arr, way) {
            var height = 0;//将为arr中所有dom元素设置的相同的高度
            // 如果没有比较的方式，则默认数组中的所有项的高度以第一个item为准
            height = $(arr[0]).height()
            if (way === 'small') {
                // 设置为最小的高度
                for (var i = 0, length = arr.length; i < length; i++) {
                    if ($(arr[i]).height() > height) {
                        height = $(arr[i]).height()
                    }
                }
            } else if (way === 'large') {
                // 设置为一个最高的高度
                for (var i = 0, length = arr.length; i < length; i++) {
                    if ($(arr[i]).height() > height) {
                        height = $(arr[i]).height()
                    }
                }
            }
            for (var i = 0, length = arr.length; i < length; i++) {
                // 如果当前项的高度与统一的高度不符合，则将其设置为计算出来的统一高度
                if ($(arr[i]).height() !== height) {
                    $(arr[i]).height(height)
                }
            }
        }
    </script>
</body>
</html>

